package com.sheep.opt;

import java.sql.PreparedStatement;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

public class OpList {
	@SuppressWarnings("unchecked")
	private List collect;
	private String sql;
	
	@SuppressWarnings("unchecked")
	public OpList(String sql) {
		this.sql = sql;
		collect = new ArrayList();
	}
	
	public final String getSql() {
		return sql;
	}
	
	@SuppressWarnings("unchecked")
	public final List getResult() {
		return collect;
	}

	public void setParam(PreparedStatement ps) throws SQLException {
	}

	public Object parse(ResultSet rs) throws SQLException {
		return null;
	}
	
	@SuppressWarnings("unchecked")
	public void add(Object ob) {
		collect.add(ob);
	}

	public void log(Logger log) {
		if (log.isDebugEnabled()) {
			log.debug(getSql());
		}
	}
}